var http=require('http');
var fs=require('fs')
var path=require('path')

//把文件内容写入到浏览器
http.createServer((req,res)=>{
    var filePath=path.join(__dirname,'/2.txt');
    var readable=fs.createReadStream(filePath);
    readable.pipe(res);

}).listen(8081);

console.log('server is listening 8081')